# $Id: PKGBUILD 89940 2013-05-05 21:33:37Z spupykin $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Chris Giles <Chris.G.27 (at) Gmail.com>

pkgname=q4wine
pkgver=1.0_r3
pkgrel=1
pkgdesc="A Qt4 GUI for Wine"
arch=("i686" "x86_64")
url="http://sourceforge.net/projects/${pkgname}/"
license=("GPL3")
if [[ $CARCH == x86_64 ]]; then
  # in multilib repo catalyst is 1st and default, so hardcode lib32-mesa-libgl
  depends=("lib32-mesa-libgl" "qt4" "wine" "sqlite3" "which" "icoutils")
  makedepends=("cmake")
else
  depends=("qt4" "wine" "sqlite3" "which" "icoutils")
  makedepends=("cmake")
fi
optdepends=("winetricks" "fuseiso")
options=('!emptydirs')
source=(http://downloads.sourceforge.net/${pkgname}/${pkgname}-${pkgver/_/-}.tar.bz2)
md5sums=('29bb4b51334a78191611f49c050950d1')

build() {
  cd ${srcdir}/${pkgname}-${pkgver/_/-}
  cmake \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DWITH_WINETRIKS=ON \
    -DLIBS_ENTRY_PATH=/usr/lib/$pkgname .
  make
}

package() {
if [[ $CARCH == x86_64 ]]; then
  # remove hardcoded lib32-mesa-libgl
  depends=(${depends[@]:1})
fi

  cd ${srcdir}/${pkgname}-${pkgver/_/-}
  make DESTDIR=${pkgdir} install
}
